import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios';

import '@/mock';
import '@/css/reset.css';
import '@/css/common.css';
import '@/iconfont/iconfont.css';
import { Form,Field,Button,Icon,Checkbox,Loading,NavBar,Tabbar, TabbarItem ,Tab, Tabs ,PullRefresh,Cell, CellGroup ,Search,Popover,IndexBar, IndexAnchor,Empty,Swipe, SwipeItem,Picker,DatetimePicker,Popup,Uploader } from 'vant';


Vue.use(Form);
Vue.use(Field);
Vue.use(Button);
Vue.use(Icon);
Vue.use(Checkbox);
Vue.use(Loading);
Vue.use(NavBar);
Vue.use(Tabbar);
Vue.use(TabbarItem);
Vue.use(Tab);
Vue.use(Tabs);
Vue.use(PullRefresh);
Vue.use(Cell);
Vue.use(CellGroup);
Vue.use(Search);
Vue.use(Popover);
Vue.use(IndexBar);
Vue.use(IndexAnchor);
Vue.use(Empty);
Vue.use(Swipe);
Vue.use(SwipeItem);
Vue.use(Picker);
Vue.use(DatetimePicker);
Vue.use(Popup);
Vue.use(Uploader);

Vue.config.productionTip = false;
Vue.prototype.$axios = axios;


Vue.prototype.$push = function(url) {
  //前进
  this.$store.commit('setTransitionName','');
  this.$router.push(url);
};
Vue.prototype.$back = function() {
  //后退
  this.$store.commit('setTransitionName','');
  this.$router.back();
}
Vue.prototype.$animatePush = function(url) {
  //slide前进
  this.$store.commit('setTransitionName','slide-rightin-leftout');
  this.$router.push(url);
};
Vue.prototype.$animateBack = function() {
  //slide后退
  this.$store.commit('setTransitionName','slide-leftin-rightout');
  this.$router.back();
}


new Vue({
  router,
  store,
  render: h => h(App),
  data:{
    transitionName:''
  }
}).$mount('#app')

